package com.hzt.agprosaleplatform.entity;

import lombok.Data;
import java.time.LocalDateTime;

/**
 * 内存存储的聊天消息实体类
 */
@Data
public class MemoryChatMessage {
    private String messageId;          // 消息ID
    private String sessionId;          // 会话ID
    private String senderId;           // 发送者ID
    private String senderName;         // 发送者名称
    private String receiverId;         // 接收者ID
    private String receiverName;       // 接收者名称
    private String messageType;        // 消息类型：text/image/file
    private String content;            // 消息内容
    private Boolean isRead;            // 是否已读
    private LocalDateTime sendTime;    // 发送时间
    
    public MemoryChatMessage(String sessionId, String senderId, String senderName, 
                           String receiverId, String receiverName, String content) {
        this.messageId = sessionId + "_" + System.currentTimeMillis();
        this.sessionId = sessionId;
        this.senderId = senderId;
        this.senderName = senderName;
        this.receiverId = receiverId;
        this.receiverName = receiverName;
        this.messageType = "text";
        this.content = content;
        this.isRead = false;
        this.sendTime = LocalDateTime.now();
    }
}